/**
 * Created by Franklin on 2017/3/14.
 */
var React = require('react');
var ReactDOM = require('react-dom');

var ModelSerTable = require('../components/model_services/model_services_table');
var ModelSerDetail = require('../components/model_services/model_service_detail');
var ModelSerInfo = require('../components/model_services/model_service_info');
var DataPreparation = require('../components/data/data_preparation');
var TaskInfo = require('../components/task/task_info');

if (document.getElementById('ModelSerTable') != null) {
    ReactDOM.render(
        <ModelSerTable
            data-source={document.getElementById('ModelSerTable').getAttribute('data-source')}
            data-type={document.getElementById('ModelSerTable').getAttribute('data-type')}
            data-host={document.getElementById('ModelSerTable').getAttribute('data-host')}
        />,
        document.getElementById('ModelSerTable'));
}

if (document.getElementById('ModelSerDetail') != null) {
    ReactDOM.render(<ModelSerDetail
        data-source={document.getElementById('ModelSerDetail').getAttribute('data-source')}
        data-type="custom"
    />,
        document.getElementById('ModelSerDetail'));
}

if (document.getElementById('ModelSerInfo') != null) {
    ReactDOM.render(<ModelSerInfo source={document.getElementById('ModelSerInfo').getAttribute('data-source')} />,
        document.getElementById('ModelSerInfo'));
}

if (document.getElementById('DataPreparation') != null) {
    ReactDOM.render(<DataPreparation
        data-source={document.getElementById('DataPreparation').getAttribute('data-source')}
        data-type={document.getElementById('DataPreparation').getAttribute('data-type')}
        data-host="CUSTOM" />,
        document.getElementById('DataPreparation'));
}

if (document.getElementById('TaskInfo') != null) {
    ReactDOM.render(<TaskInfo source={document.getElementById('TaskInfo').getAttribute('data-source')} />,
        document.getElementById('TaskInfo'));
}